<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="ar.edu.utn.frgp.model.Cliente" %>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<link rel="stylesheet" href="CSS/estilo.css" type="text/css" media="all">

<title>Clientes</title>

<script type="text/javascript">	
	function validar() {	
		
		for(var i = 0 ; i < frmClientes.idClientes.length; i++){		
			if(frmClientes.idClientes[i].checked){
				frmClientes.submit();
				return true;
			}
		} 
	alert('Debes seleccionar al menos un cliente.'); 
	return false;      
}
</script>

</head>
<body>

<div id="divPrincipal" class="bordesRedondeados">
	<div id="divMenu" class="bordesRedondeados">
		<ul style="list-style-type: none;">
			<li><a href="menu.jsp" class="links">Home</a></li><br>
			<li><a href="paquetes" class="links">Seleccion	de	paquete</a></li><br>									
		</ul>
	</div>
	<div id="divSubMenu" class="bordesRedondeados">
		<span class="titulo">SELECCION CLIENTE</span><br><br>
		<form name="frmClientes" action="reservaClienteservlet" method="post"> 	
			<table  width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">	
				<tr>
					<th scope="col">Nro de Cliente</th>
					<th scope="col">Dni</th>
					<th scope="col">Nombre</th>
					<th scope="col">Apellido</th>
					<th scope="col">Selec.</th>
					
				</tr>
		
				<tbody>
				
		
				
					<c:forEach items="${ clientes }" var="cli">
		
						<tr>
							<td>${ cli.id }</td>
							<td>${ cli.dni }</td>
							<td>${ cli.nombre }</td>
							<td>${ cli.apellido }</td>
							<td> 
							
							<input type="checkbox" name="idClientes" value=${ cli.id }>
										
							</td>
							
						</tr>
					</c:forEach>
				</tbody>
				<tr border = 0>
							
			</tr>		
			</table>			
			<td><input type="button" value="Reserva" onclick="validar()" ></td>		
			<td><input type="button" onclick="location.href='addCliente' " value="Agregar"/></td>
			<td><input type="button" onclick="location.href='menu.jsp' " value="Cancelar"/></td>		
		</form>		
	</div>	
</div>
</body>
</html>